<#include "../header.ftl">
<link href="${TEMPLATE_PATH}/css/user_base.css" rel="stylesheet" type="text/css" />
<link href="${TEMPLATE_PATH}/css/user_login.css" rel="stylesheet" type="text/css" />
 <div id="position">您所在的位置：<a href="{webroot}">首页</a> > <a href="{webroot}user/login.asp">会员登录</a></div>
    <div class="w980 mt10 mc">
        <div class="w900 bt">
           <div class="title">会员登录</div>
           <div id="userbase">
               <div class="left">
                    <form class="form_login" method="post">
                    <ul id="login">
                        <li class="msg" id="msg"></li>
                        <li>账户：<input type="text" name="userEntity.userName" id="userName" class="ip" data-rule="账户:required;username;" /></li>
                        <li>密码：<input type="password" name="userEntity.passWord" id="passWord" class="ip" data-rule="密码:required;password;" /></li>
                        <li class="p42"><input type="submit" value="登录" class="bnt_yellow" /> <input type="button" value="忘记密码" onclick="location.href='getpass.asp'" class="bnt_blue" /></li>
                    </ul>
                    </form>
               </div>
               <div class="midline"></div>
               <div class="info">
                   <p>还没有帐号？</p>
                   <p class="bnt"><a href="/user/reg.htm">立即注册</a></p>
               </div>
           </div>
        </div>
    </div>
<script>
$(function(){
	$(".form_login").validator(
	{
		stopOnError:true,
		theme:'yellow_right_effect',
		ignore:':hidden',
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"/user/login.json",
				type:"post",
				data:$(form).serialize(),
				dataType:"json",
				success:function(data){
					var type="warn";
					if(data.result==true){type="ok";}
					$.fn.tips({type:type,content:data.msg});
					if(data.result==true)
					{
						setTimeout(function(){location.href="/user/index.htm"},2500);
					}
				},
				error:function(XMLHttpRequest, textStatus, errorThrown){
					$.fn.tips({type:"error",content:XMLHttpRequest.responseText});
				}
			});
		}
	});
})
</script>
<#include "../footer.ftl">